---
layout: overview
title: Getting Started
item: getting-started
---
      <main class="c-content">
        <section class="c-section">
          <div class="c-container -padded">
            <h1 class="c-heading -h2">Getting started</h1>
          </div>
        </section>
        <section class="c-section x-greylight">
          <div class="c-container -padded">
            <h2 class="c-heading -h3">Install</h2>
            <p>Assuming you have already installed Node...</p>
            <div class="c-grid">
              <div class="_col -col-1-3">
                <p>Install the LoopBack CLI tool.</p>
              </div>
              <div class="_col -col-2-3">
                <pre class="cli"><span class="prompt">$</span> npm install -g loopback-cli</pre>
              </div>
            </div>
          </div>
        </section>
        <section class="c-section">
          <div class="c-container -padded">
            <h2 class="c-heading -h3">Create app</h2>
            <div class="c-grid">
              <div class="_col -col-2-3">
                <p>Create a "Hello World" LoopBack application.</p>
                <br/>
              </div>
              <div class="_col -col-2-3">
                <pre class="cli"><span class="prompt">$</span> lb
<span class="prompt">?</span> What's the name of your application? <span class="input">hello-world</span>
<span class="prompt">?</span> Enter name of the directory to contain the project: <span class="input">hello-world</span>

<span class="prompt">?</span> Which version of LoopBack would you like to use? 3.x (current)
<span class="prompt">?</span> What kind of application do you have in mind? hello-world (A project containing a controller,
including a single vanilla Message and a single remote method)
...
I'm all done. Running npm install for you to install the required dependencies.
If this fails, try running the command yourself.
... </pre>
              </div>
            </div>
          </div>
        </section>
        <section class="c-section x-greylight">
          <div class="c-container -padded">
            <div class="c-grid">
              <div class="_col -col-1-3">
                <h2 class="c-heading -h3">Create models</h2>
              </div>
              <div class="_col -col-2-3">
                <pre class="cli"><span class="prompt">$</span> lb model</pre>
              </div>
            </div>
            <hr/>
            <div class="c-grid">
              <div class="_col -col-1-3">
                <p>The generator guides you through creating your model. Enter the values highlighted in green. To accept the default, just press Enter.</p>
              </div>
              <div class="_col -col-2-3">
                <pre class="cli"><span class="prompt">[?]</span> Enter the model name: <span class="input">person</span>
<span class="prompt">[?]</span> Select the data-source to attach person to: <span class="input">db (memory)</span>
<span class="prompt">[?]</span> Select model`s base class <span class="input">(PersistedModel)</span>
<span class="prompt">[?]</span> Expose person via the REST API? <span class="input">Yes</span>
<span class="prompt">[?]</span> Custom plural form (used to build REST URL): <span class="input">people</span>
<span class="prompt">[?]</span> Common model or server only? <span class="input">common</span>
Let's add some person properties now.</pre>
              </div>
            </div>
            <hr/>
            <div class="c-grid">
              <div class="_col -col-1-3">
                <p>Define a firstname property for the person model</p>
              </div>
              <div class="_col -col-2-3">
                <pre class="cli">Enter an empty property name when done.
<span class="prompt">[?]</span> Property name: <span class="input">firstname</span></pre>
              </div>
            </div>
            <hr/>
            <div class="c-grid">
              <div class="_col -col-1-3">
                <p>Hit Enter to accept the default string type:</p>
              </div>
              <div class="_col -col-2-3">
                <pre class="cli"><span class="prompt">[?]</span> Property type: (Use arrow keys)
❯ string
  number
  boolean
  object
  array
  date
  buffer
  geopoint
  any
  (other)</pre>
              </div>
            </div>
            <hr/>
            <div class="c-grid">
              <div class="_col -col-1-3">
                <p>Make the property required.</p>
              </div>
              <div class="_col -col-2-3">
                <pre class="cli"><span class="prompt">[?]</span> Required? (y/N) <span class="input">y</span></pre>
              </div>
            </div>
            <hr/>
            <p>Repeat these steps for lastname property.</p>
            <p>Press Enter when prompted for a property name to finish up and create the model.</p>
          </div>
        </section>
        <section class="c-section">
          <div class="c-container -padded">
            <h2 class="c-heading -h3">Run the application</h2><a name="run"></a>
            <div class="c-grid">
              <div class="_col -col-2-5">
                <p>Run as you would any Node application.</p>
              </div>
              <div class="_col -col-3-5">
                <pre class="cli"><span class="prompt">$</span> node .
Browse your REST API at http://0.0.0.0:3000/explorer
Web server listening at: http://0.0.0.0:3000/</pre>
              </div>

              <div class="_col -col-1-1"><br/>
                <p>When you're ready to think about moving to production, give <a href="https://developer.ibm.com/apiconnect/">IBM API Connect</a> a try. 
                      It enables you to easily deploy your LoopBack app to the cloud or on-premises.  It has a built-in API gateway, and it has a visual editor for LoopBack apps!</p>
              </div>
            </div>
          </div>
        </section>
        <section class="c-section x-greylight">
          <div class="c-container -padded">
            <h2 class="c-heading -h3">Explore your REST API</h2>
            <div class="c-grid">
              <div class="_col -col-1-3">
                <p>Load <a href="http://0.0.0.0:3000/explorer">http://0.0.0.0:3000/explorer</a> to see the built-in API Explorer.</p>
                <p>The API Explorer enables you to exercise all the generated API endpoints. There are create, read, update, and delete (CRUD) endpoints for the people model you just created.</p>
                <p>For more information, see the <a href="/doc/en/lb3/Use-API-Explorer.html">Using the API Explorer</a> in the documentation. You may also want to follow the <a href="/doc/en/lb3/Getting-started-with-LoopBack.html">Getting Started</a> tutorial.</p>
              </div>
              <div class="_col -col-2-3"><img src="/images/overview/helloworld-api-explorer.png" class="x-img-span"/></div>
            </div>
          </div>
        </section>
      </main>
